use std::fmt::Error;

pub fn new_birthday_probability(n: u32) -> f64 {
    if n < 2 {
        panic!("people num must be greater than 1");
    }
    let mut ratio = 1f64;
    for i in 1..n {
        ratio *= 1.0 - (i as f64) / 365.0;
    }
    1.0 - ratio
}
